#bytearray
Description: Type conversion to bytearray
.
def bytearray(x):
'''
Type conversion to bytearray
:param x: A variable
:return: The value of x converted to bytearray
'''
Example:
print(bytearray(10)) # A bytearray object of length 10, all values 0
print(bytearray(b'hello')) # from bytes
print(bytearray('hello', encoding='utf-8')) # from str